package com.yy.market.mvp.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.yy.market.mvp.presenter.BasePresenter;


/**
 * Created by luweibin on 2016/6/15.
 */
public abstract class BaseActivity<T extends BasePresenter> extends AppCompatActivity {
    T presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        initPresenter();
        initView();
        loadData();
    }

    protected abstract int getLayoutId();

    protected abstract void initPresenter();

    protected abstract void loadData();

    protected abstract void initView();
    /**
     * 显示正在加载动画图
     */
    public void showProgress() {

    }

    /**
     * 隐藏正在加载图
     */
    public void dismissProgress() {

    }
}
